# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-requests-cache
_pkgname=requests_cache
pkgver=1.2.1
pkgrel=3
pkgdesc='Persistent cache for requests library.'
arch=('any')
url='https://pypi.org/project/requests-cache/#files'
license=('BSD')
depends=('python' 'python-requests')
makedepends=('python-pip' 'python-build' 'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('774c82eb2c78b44a74b5a836c2d2362a2a7ada6467befe3d96dc204cb76eb12d6e3229613fa8d9eddbc27180565a50bf604c306ce93f4b0db9f8c168f26cdc81')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

